baseline <- DSMhabitat::fr_spawn$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::fr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::fr_spawn$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::fr_spawn$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::fr_spawn$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
spawn <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1979:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 8,184
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 197…
## $ baseline <dbl> 63.3597855, 15.2083236, 0.3847834, 10.6933197, 9.6439641,…
## $ run_of_river <dbl> 61.6205248, 15.1219018, 0.3827854, 10.7527705, 9.6788451,…
## $ tmh <dbl> 329.437196, 14.592170, 22.371714, 8.121899, 13.340559, 44…
## $ ror_tmh <dbl> 313.824711, 14.451301, 22.439135, 8.167054, 13.388810, 40…
spawn %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass', "Upper-mid Sacramento River", "Lower-mid Sacramento River", "Lower Sacramento River", "San Joaquin River"))) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line(alpha = .75) +
facet_wrap(~watershed, scales = 'free_y') +
theme_minimal()
baseline <- DSMhabitat::fr_fry$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::fr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::fr_fry$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::fr_fry$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::fr_fry$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
fry <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 7,812
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ baseline <dbl> 27.9510027, 28.4613903, 2.6182671, 16.4905863, 13.4403433…
## $ run_of_river <dbl> 29.4839934, 28.1553568, 2.6182671, 16.4132850, 13.3497777…
## $ tmh <dbl> 1053.97129, 42.74295, 92.36974, 31.65986, 49.71230, 29.74…
## $ ror_tmh <dbl> 972.335652, 35.823084, 92.369739, 31.511451, 49.158876, 2…
fry %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass'))) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line() +
facet_wrap(~watershed, scales = 'free_y')
baseline <- DSMhabitat::fr_juv$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::fr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::fr_juv$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::fr_juv$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::fr_juv$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
juv <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 7,812
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ baseline <dbl> 27.9510027, 25.0079447, 4.8769938, 16.5835547, 11.5038707…
## $ run_of_river <dbl> 29.4839934, 23.8900193, 4.8769938, 16.3056130, 11.1639330…
## $ tmh <dbl> 1053.97129, 32.67797, 92.36974, 37.59226, 44.82550, 21.38…
## $ ror_tmh <dbl> 972.335652, 33.717369, 92.369739, 36.962213, 43.764262, 2…
juv %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass'))) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line() +
facet_wrap(~watershed, scales = 'free_y')
baseline <- DSMhabitat::fr_fp$r_to_r_baseline %>% DSMhabitat::square_meters_to_acres()
# run_river_without_proj_catalog_added <- DSMhabitat::fr_spawn$run_of_river %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::fr_fp$max_flow_w_hab_projects %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::fr_fp$r_to_r_tmh %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::fr_fp$run_of_river_tmh %>% DSMhabitat::square_meters_to_acres()
fp <- expand_grid(
watershed = factor(DSMscenario::watershed_labels,
levels = DSMscenario::watershed_labels),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
baseline = as.vector(baseline),
# run_river_without_proj_catalog_added = as.vector(run_river_without_proj_catalog_added),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 7,812
## Columns: 7
## $ watershed <fct> Upper Sacramento River, Antelope Creek, Battle Creek, Bea…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ baseline <dbl> 5.360953, 8.188308, 0.000000, 3.324882, 0.000000, 40.2486…
## $ run_of_river <dbl> 20.442699, 10.988530, 0.000000, 3.573687, 0.000000, 43.10…
## $ tmh <dbl> 690.42239, 321.20716, 0.00000, 142.34552, 0.00000, 338.08…
## $ ror_tmh <dbl> 573.11961, 135.14819, 0.00000, 87.64332, 0.00000, 341.510…
fp %>%
transmute(watershed, date = ymd(paste(year, month, 1)), baseline, run_of_river, tmh, ror_tmh) %>%
filter(!(watershed %in% c('Sutter Bypass', 'Yolo Bypass'))) %>%
# filter(watershed == "Lower-mid Sacramento River") |>
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version)) +
geom_line(alpha = .75) +
facet_wrap(~watershed, scales = 'free_y') +
theme_minimal()
Something funky going on with Lower-mid sac fp habitat
sit_habitat <- DSMhabitat::delta_habitat$sit_habitat[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
baseline <- DSMhabitat::delta_habitat$r_to_r_baseline[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
run_of_river <- DSMhabitat::delta_habitat$max_flow_w_hab_projects[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
tmh <- DSMhabitat::delta_habitat$r_to_r_tmh[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
ror_tmh <- DSMhabitat::delta_habitat$run_of_river_tmh[,, "North Delta"] %>% DSMhabitat::square_meters_to_acres()
delta <- expand_grid(
watershed = c("North Delta"),
month = 1:12,
year = 1980:2000) %>%
arrange(year, month, watershed) %>%
mutate(
sit_habitat = as.vector(sit_habitat),
baseline = as.vector(baseline),
run_of_river = as.vector(run_of_river),
tmh = as.vector(tmh),
ror_tmh = as.vector(ror_tmh)) |> glimpse()
## Rows: 252
## Columns: 8
## $ watershed <chr> "North Delta", "North Delta", "North Delta", "North Delta…
## $ month <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, …
## $ year <int> 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 1980, 198…
## $ sit_habitat <dbl> 4796.375, 3648.276, 5023.072, 4826.862, 2594.710, 4486.45…
## $ baseline <dbl> 9308.159, 7080.082, 9748.101, 9367.324, 5035.463, 8706.70…
## $ run_of_river <dbl> 9308.159, 7080.082, 9748.101, 9367.324, 5035.463, 8706.70…
## $ tmh <dbl> 37421.05, 28463.64, 39189.73, 37658.91, 20243.78, 35003.0…
## $ ror_tmh <dbl> 37421.05, 28463.64, 39189.73, 37658.91, 20243.78, 35003.0…
delta %>%
transmute(watershed, date = ymd(paste(year, month, 1)), sit_habitat, baseline, run_of_river, tmh, ror_tmh) %>%
gather(version, acres, -watershed, -date) %>%
ggplot(aes(date, acres, color = version, linetype = version)) +
geom_line(alpha = .75) +
facet_wrap(~watershed, scales = 'free_y') +
theme_minimal()